package com.g5kj.coupon.ssm.common;

import java.io.Serializable;

/**
 * 返回实体类
 */
public class Result implements Serializable{
    public int code=200;
    private Object data;

    private Result(int code, Object data){
        this.code=code;
        this.data=data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static  Result ok(Object data){
        return new Result(200,data);
    }
    public static Result fail(Object data){
        return new Result(0,data);
    }

    public  boolean isOk(){
        return this.code==200;
    }
}
